/**
 * 			
 */

(function($){
	var str = '<h3 class="data_header title"><img src="../../img/pypj.png" />评优评奖</h3>'
			+ '<ul class="other_info_lists pypj_data">'
			+ '<li>'
			+ '<h3 class="data_header"><img src="../../img/SJ-JBXX_06.png" />获奖情况</h3>'
			+ '<table cellspacing="0" name="pjpy">'
			+ '<thead>'
			+ '<tr>'
			+ '<th name="pjzq"><img src="../../img/SJ-XMFH_10.png" />评奖周期</th>'
			+ '<th name="jx"><img src="../../img/SJ-XMFH_10.png" />奖项</th>'
			+ '<th name="jxje"><img src="../../img/SJ-XMFH_10.png" />奖项金额</th>'
			+ '<th name="sqsj"><img src="../../img/SJ-XMFH_10.png" />申请时间</th>'
			+ '</tr>'
			+ '</thead>'
			+ '<tbody>'
			+ '</tbody>' + '</table>' + '</li>' + '</ul>';
	$('div.charts_right').css({'background':'transparent','border':'0px solid #d2d2d2'}).append(str);
	
	$.getJSON(
			'/WDDXSERVER/report/getStudentPJPY?callback=?',
			{
				userid : user_id,ticket:ticket
			},
			function(data) {
				data = data.content.message;
				$('ul.other_info_lists table').each(
					 function() {
									var $this = $(this);
									var parent = $this.attr('name');
									var length = data[parent].length;
									var $node = $this.find('tbody');
									var name = [];
									$this.find('thead th').each(
									   function() {
													name[$(this).index()] = $(this).attr('name');
													});
									var the_length = name.length;
									var appendnode = [];
									if (length == 0)
										$node.append('<td colspan="'
												+ the_length
												+ '">暂无数据</td>');
									else {
										for (var i = 0; i < length; i++) {
											var append_node = [];
											for (var j = 0; j < the_length; j++) {
												append_node[j] = '<td>'
														+ data[parent][i][name[j]]
														+ '</td>';
											}
											appendnode[i] = '<tr>'
													+ append_node.join('')
													+ '</tr>';
										}
										$node.append(appendnode.join(''));
									}

								});
			});
	
})(jQuery);